<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Dashboard</title>

    <!-- Custom fonts for this template-->
    <link href="../vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="../css/sb-admin-2.min.css" rel="stylesheet">

</head>

<body id="page-top">
<%@ include file="../components/checkLoginState.jsp"%>
<jsp:useBean id="getQuestions" class="system.getQuestions" scope="page"/>
<%!
String testid,studentid;
int question_count;
String[][] question_list;
%>
<%
testid=request.getParameter("testid");
studentid=(String)session.getAttribute("userid");

question_count=getQuestions.getCount(testid);
question_list=new String[question_count][3];
question_list=getQuestions.getQuestionsList(testid);
%>


<div class="card card-body">
    <%String question_type="";
        int type_tag=0;
        for(int i=0;i<question_count;i++){
            type_tag=Integer.parseInt(question_list[i][1].trim());
            if(type_tag==1){
                question_type="singleAnalysis_part.jsp";
                }else if(type_tag==2){
                    question_type="multipleAnalysis_part.jsp";
                }else if(type_tag==3){
                    question_type="subjectAnalysis_part.jsp";
                }
    %>

    <jsp:include page="<%=question_type%>">
        <jsp:param name="testid" value="<%=testid%>"/>
        <jsp:param name="questionid" value="<%=question_list[i][0]%>"/>
        <jsp:param name="questionNo" value="<%=question_list[i][2]%>"/>
    </jsp:include>

    <%}%><br><br>

        
</div>




</body>
</html>